package com.example.snakefinal;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Point;

public class BadApple extends Food {
    BadApple(Context context, Point location, int size) {

        // Make a note of the passed in spawn range
        this.mSpawnRange = location;
        this.mSize = size;
        this.value = 0;
        this.mBitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.badapple);
        this.mBitmap = Bitmap.createScaledBitmap(this.mBitmap, size, size, false);
        this.spawn();
    }


    @Override
    public void applyMod(SnakeGame game, Snake snake) {
        snake.increaseScore(value);
        if (snake.getSpeed() > 3) {
            snake.setSpeed(snake.getSpeed() - 1);
        }
        this.spawn();
    }
}
